package day1119;

import java.util.Scanner;//1.

//用Scanner输入一个数字n，求它的阶乘
//6:   1 *  2  * 3  *4  *5 *6
public class Demo3 {
    public static void main(String[] args) {
        long result=1;
        Scanner  sc=new Scanner(System.in);//2.
        System.out.println("请输入一个要求阶乘的数：");
        int n=sc.nextInt();//3.
        int i=1;
        while(i<=n){
            result=result * i;
            i++;
        }
        System.out.println(result);
    }
}
